package com.xdxc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdxc.model.entity.ProcessedBatch;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper // 标记为 MyBatis 的 Mapper 接口
public interface ProcessedBatchMapper extends BaseMapper<ProcessedBatch> {
    // 修改Mapper接口（MyBatis示例）
    @Select("SELECT CASE WHEN COUNT(*) > 0 THEN true ELSE false END FROM processed_batch WHERE batch_id = #{batchId}")
    Boolean existsByBatchId(@Param("batchId") String batchId);

    @Insert("INSERT INTO processed_batch(batch_id, exam_id) VALUES (#{batchId}, #{examId})")
    int insert(ProcessedBatch entity);
}